﻿@model ResumeListModel
@{
    ResLink.AddCss("~/res/css/resume/list.css");
}

<script type="text/javascript">
    function 페이지크기변경(size) {
        var url = '@Html.Raw(Url.ResumeListResize(Model.pagination.ID.Value, 9991))';
        location.href = url.replace("9991", size);
    }

    function 정렬순서변경(order) {
        var url = '@Html.Raw(Url.ResumeListSort(Model.pagination.ID.Value, 9991))';
        location.href = url.replace("9991", order);
    }

    function 검색() {
        var url = '@Html.Raw(Url.ResumeListSearch(Model.pagination.ID.Value, 9991, "9992"))';
        var 검색유형 = $('select[name$=srchType]').val();
        var 검색어 = encodeURIComponent($('input[name$=srchText]').val().trim());
        location.href = url.replace("9991", 검색유형).replace("9992", 검색어);
    }
</script>    

@if (Model.pagination.ID.Value == 0) {
    <h1>이력서 목록</h1>
} else {
    <h1>지원자 목록</h1>
}
<hr />

<div class="form-inline">
    정렬:
    @Html.DropDownListFor(m => m.pagination.order, BL이력서.이력서정렬순서목록, new { onchange = "정렬순서변경(this.value)" })

    @Html.DropDownListFor(m => m.pagination.srchType, BL이력서.이력서검색유형목록)
    @Html.TextBoxFor(m => m.pagination.srchText)
    <a class="btn btn-small" onclick="검색()">검색</a>
</div>

<table class="table table-condensed table-bordered">
    <thead>
        <tr>
            <th>이름</th>
            <th>생년월일</th>
            <th>성별</th>
            <th>전업여부</th>
            <th>연락처</th>
            <th>최종학위</th>
            <th>최근경력</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var 항목 in Model.요약목록) {            
            <tr onclick="window.open('/report/resume.aspx?type=p&id=@항목.사용자ID')">
                <td>@항목.이름</td>
                <td>@항목.생년월일</td>
                <td>@항목.성별</td>
                <td>@항목.강사전업여부</td>
                <td>@항목.연락처</td>
                <td>@항목.최종학위</td>
                <td>@항목.최근교육</td>
            </tr>
        }
    </tbody>
</table>

<div class="controls pull-right form-inline">
    화면크기: 
    @Html.DropDownListFor(m => m.pagination.size, new SelectList(Consts.페이지크기목록), new { onchange = "페이지크기변경(this.value)" })
</div>

@Html.Partial("_Pagination", Model.pagination)

<hr />
<div class="controls">
    <a class="btn" onclick="window.open('/report/resumelist.aspx?id=@Model.pagination.ID')"><i class="icon-print"></i> 전체 목록 출력</a>
    <a class="btn" onclick="window.open('/report/resume.aspx?type=a&id=@Model.pagination.ID')"><i class="icon-print"></i> 전체 이력서 출력</a>
    @if (Model.pagination.ID.Value > 0) {
        <a class="btn btn-small" onclick="window.open('/report/application.aspx?type=a&id=@Model.pagination.ID')"><i class="icon-print"></i> 전체 심사서 출력</a>
    }
</div>

